package com.bjpowernode.mapper;

import com.bjpowernode.model.FinanceAccount;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

public interface FinanceAccountMapper {



    int deleteByPrimaryKey(Integer id);

    int insert(FinanceAccount record);

    int insertSelective(FinanceAccount record);

    FinanceAccount selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FinanceAccount record);

    int updateByPrimaryKey(FinanceAccount record);


    /**
     * @param uid
     * @return
     */
    FinanceAccount selectByUid(@Param("uid") Integer uid);

    /**
     * 查询用户上锁
     * @param uid
     * @return
     */
    FinanceAccount selectForUpdate(@Param("uid") Integer uid);

    //投扣除金额
    int  updateMoneyByInvest(@Param("uid") Integer uid, @Param("money") BigDecimal money);

    /**
     * 收益返还，增加金额
     * @param uid
     * @param bidMoney
     * @param incomeMoney
     * @return
     */
    int updateMoneyByIncomeBack(@Param("uid") Integer uid, @Param("bidMoney") BigDecimal bidMoney, @Param("incomeMoney") BigDecimal incomeMoney);
}